// 隔多少秒执行一次
export const _mt = function throttle(func, wait) {
    let timeout;
    return function(...args) {
        if (!timeout) {
            timeout = setTimeout(() => {
                func(...args)
                timeout = null;
            }, wait)
        }
    }
}
// 防抖
export const _md = function debounce(func, wait) {
    let timeout;
    return function (...args) {
        if (timeout) clearTimeout(timeout);
        timeout = setTimeout(() => {
            func(...args)
            timeout = null;
        }, wait);
    }
}
